﻿using System.IO;

namespace ninject.configurer.tests
{
    public interface IGreeterConfig
    {
        string Greeting { get; set; }
    }

    public class GreeterConfig : IGreeterConfig
    {
        public string Greeting { get; set; }

        public GreeterConfig()
        {
        }

        public GreeterConfig(string greeting)
        {
            Greeting = greeting;
        }
    }

    public class Greeter
    {
        private readonly TextWriter _writer;
        private readonly GreeterConfig _config;

        public Greeter(TextWriter writer, GreeterConfig config)
        {
            _writer = writer;
            _config = config;
        }

        public void Greet()
        {
            _writer.Write(_config.Greeting);
        }
    }
}